package com.ruoyi.manage.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.manage.mapper.SalSalaryDeductMapper;
import com.ruoyi.manage.domain.SalSalaryDeduct;
import com.ruoyi.manage.service.ISalSalaryDeductService;

/**
 * 薪资扣款项配置Service业务层处理
 * 
 * @author cf
 * @date 2025-06-04
 */
@Service
public class SalSalaryDeductServiceImpl implements ISalSalaryDeductService 
{
    @Autowired
    private SalSalaryDeductMapper salSalaryDeductMapper;

    /**
     * 查询薪资扣款项配置
     * 
     * @param id 薪资扣款项配置主键
     * @return 薪资扣款项配置
     */
    @Override
    public SalSalaryDeduct selectSalSalaryDeductById(Long id)
    {
        return salSalaryDeductMapper.selectSalSalaryDeductById(id);
    }

    /**
     * 查询薪资扣款项配置列表
     * 
     * @param salSalaryDeduct 薪资扣款项配置
     * @return 薪资扣款项配置
     */
    @Override
    public List<SalSalaryDeduct> selectSalSalaryDeductList(SalSalaryDeduct salSalaryDeduct)
    {
        return salSalaryDeductMapper.selectSalSalaryDeductList(salSalaryDeduct);
    }

    /**
     * 新增薪资扣款项配置
     * 
     * @param salSalaryDeduct 薪资扣款项配置
     * @return 结果
     */
    @Override
    public int insertSalSalaryDeduct(SalSalaryDeduct salSalaryDeduct)
    {
        salSalaryDeduct.setCreateTime(DateUtils.getNowDate());
        return salSalaryDeductMapper.insertSalSalaryDeduct(salSalaryDeduct);
    }

    /**
     * 修改薪资扣款项配置
     * 
     * @param salSalaryDeduct 薪资扣款项配置
     * @return 结果
     */
    @Override
    public int updateSalSalaryDeduct(SalSalaryDeduct salSalaryDeduct)
    {
        salSalaryDeduct.setUpdateTime(DateUtils.getNowDate());
        return salSalaryDeductMapper.updateSalSalaryDeduct(salSalaryDeduct);
    }

    /**
     * 批量删除薪资扣款项配置
     * 
     * @param ids 需要删除的薪资扣款项配置主键
     * @return 结果
     */
    @Override
    public int deleteSalSalaryDeductByIds(Long[] ids)
    {
        return salSalaryDeductMapper.deleteSalSalaryDeductByIds(ids);
    }

    /**
     * 删除薪资扣款项配置信息
     * 
     * @param id 薪资扣款项配置主键
     * @return 结果
     */
    @Override
    public int deleteSalSalaryDeductById(Long id)
    {
        return salSalaryDeductMapper.deleteSalSalaryDeductById(id);
    }
}
